package com.pzh.usercenter.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.pzh.usercenter.model.domain.User;
import jakarta.servlet.http.HttpServletRequest;

import java.util.List;

/**
* @author fc3379757631
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2024-11-15 22:36:54
*/
public interface UserService extends IService<User> {

    /**
     * 用户注册
     * @param userAccount 用户账号
     * @param userPassword 用户密码
     * @param checkPassword 校验密码
     * @return 返回id
     */
    long userRegister(String userAccount, String userPassword,String checkPassword,String planetCode);

    /**
     * 用户登录
     *
     * @param userAccount  用户账号
     * @param userPassword 用户密码
     * @param request
     * @return 用户
     */
    User doLogin(String userAccount, String userPassword, HttpServletRequest request);

    /**
     * 用户脱敏
     * @param user
     * @return
     */
    User getSafetyUser(User user);

    /**
     * 用户注销
     * @param request
     * @return
     */
    int userLogout(HttpServletRequest request);

    /**
     * 根据标签搜索用户
     * @param tagNameList
     * @return
     */
    List<User> searchUsersByTags(List<String> tagNameList);

    int updateUser(User user, User loginUser);

    /**
     * 是否为管理员
     * @param request
     * @return
     */
     boolean isAdmin(HttpServletRequest request);

    boolean isAdmin(User user);

    /**
     * 获取当前用户信息
     * @param request
     * @return
     */
     User getLoginUser(HttpServletRequest request);

    /**
     * 获取推荐用户
     * @param pageSize
     * @param pageNum
     * @param request
     * @return
     */
    Page<User> getRecommendUsers(long pageSize, long pageNum, HttpServletRequest request);

    /**
     * 获取最匹配用户
     * @param num
     * @param loginUser
     * @return
     */
    List<User> matchUsers(long num, User loginUser);
}
